package net.turkishpt;
/**
 * Enumeration for phone keys. 
 * @author alp
 *
 */
public enum PhoneKey {
	ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE;
	
	public 	static PhoneKey getPhoneKey(int c){
		switch(c){
			case 1: return ONE;
			case 2: return TWO; 
			case 3: return THREE; 
			case 4: return FOUR; 
			case 5: return FIVE; 
			case 6: return SIX;
			case 7: return SEVEN;
			case 8: return EIGHT;
			case 9: return NINE;
			default: return null; 
		}
			
	}
	
	public static PhoneKey[] intToPhoneKeys(int[] c){
		PhoneKey[] tmp = new PhoneKey[c.length];
		
		for(int i = 0 ; i < c.length; i++){
			tmp[i]= (c[i] == 1) ? ONE : (c[i] == 2) ? TWO :  (c[i] == 3) ? THREE :
				 	(c[i] == 4) ? FOUR :  (c[i] == 5) ? FIVE :  (c[i] == 6) ? SIX :
					(c[i] == 7) ? SEVEN :  (c[i] == 8) ? EIGHT :  (c[i] == 9) ? NINE :
					null;
		}
		
		return tmp;
	}
}
